package com.wyzz.hr.pojo;

import java.math.BigDecimal;
import java.util.Date;
import org.apache.commons.lang.StringUtils;

import com.wyzz.hr.pojo.base.BaseTrcourseplan;

public class Trcourseplan extends BaseTrcourseplan {

	public Trcourseplan() {
	}

	public Trcourseplan(String trcpId) {
		super(trcpId);
	}

	public Trcourseplan(String trcpId, String trcpNo, Employee trcpCreateBy,
			Trcourse trcpCourseNo, Employee trcpLastChangeBy,
			BigDecimal trcpBudgetHour, Date trcpStartDate, Date trcpEndDate,
			Integer trcpStatus, Date trcpCreateTime, Date trcpLastChangeTime) {
		super(trcpId, trcpNo, trcpCreateBy, trcpCourseNo, trcpLastChangeBy,
				trcpBudgetHour, trcpStartDate, trcpEndDate, trcpStatus,
				trcpCreateTime, trcpLastChangeTime);
	}

	public void copyPartFrom(Trcourseplan t) {
		setTrcpCourseNo(new Trcourse(t.getTrcpCourseNo().getTrcNo()));
		setTrcpNo(t.getTrcpNo());
		setTrcpDeptLimit(t.getTrcpDeptLimit());
		setTrcpStatus(t.getTrcpStatus());
		setTrcpBudgetYear(t.getTrcpBudgetYear());
		setTrcpBudgetFee(t.getTrcpBudgetFee());
		setTrcpAttendeeNo(t.getTrcpAttendeeNo());
		setTrcpActualFee(t.getTrcpActualFee());
		setTrcpBudgetHour(t.getTrcpBudgetHour());
		setTrcpStartDate(t.getTrcpStartDate());
		setTrcpEndDate(t.getTrcpEndDate());
		setTrcpEnrollStartDate(t.getTrcpEnrollStartDate());
		setTrcpLocation(t.getTrcpLocation());
		setTrcpEnrollEndDate(t.getTrcpEnrollEndDate());
		if (t.getTrcpCoordinator() != null
				&& StringUtils.isNotEmpty(t.getTrcpCoordinator().getId()))
			setTrcpCoordinator(new Employee(t.getTrcpCoordinator().getId()));
		else
			setTrcpCoordinator(null);
		if (t.getTrcpTrinsId() != null
				&& StringUtils.isNotEmpty(t.getTrcpTrinsId().getTrinsId()))
			setTrcpTrinsId(new TrInstructor(t.getTrcpTrinsId().getTrinsId()));
		else
			setTrcpTrinsId(null);
		if (t.getTrcpTroId() != null
				&& StringUtils.isNotEmpty(t.getTrcpTroId().getTroId()))
			setTrcpTroId(new TrOrg(t.getTrcpTroId().getTroId()));
		else
			setTrcpTroId(null);
		if (t.getTrcpTrclId() != null
				&& StringUtils.isNotEmpty(t.getTrcpTrclId().getTrclId()))
			setTrcpTrclId(new Trclass(t.getTrcpTrclId().getTrclId()));
		else
			setTrcpTrclId(null);
	}

	public String getLimitDeptName() {
		return limitDeptName;
	}

	public void setLimitDeptName(String limitDeptName) {
		this.limitDeptName = limitDeptName;
	}

	private static final long serialVersionUID = 1L;
	private String limitDeptName;
}
